﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace KP_CommonLibrary.KP_CommonControls
{
    #region KPButton
    public class KPButton : DevComponents.DotNetBar.ButtonX
    {
        public KPButton()
        {
            base.Size = new Size(80, 28);
            //base.Font = new Font("Arial", 9, FontStyle.Regular);
            base.BackColor = System.Drawing.Color.White;
            base.ForeColor = System.Drawing.Color.MediumBlue;                      
            base.Cursor = System.Windows.Forms.Cursors.Hand;
            VisibleChanged += new EventHandler(KPButton_VisibleChanged);
        }

        void KPButton_VisibleChanged(object sender, EventArgs e)
        {
            Font = KP_UIConfig.ControlFont;
        }

        private void InitializeComponent()
        {
            this.SuspendLayout();
            this.ResumeLayout(false);
        }
    }
    #endregion
    public static class KP_UIConfig
    {
        public static float FontSize = 9;
        private static string FontName = "Arial";
        static KP_UIConfig()
        {
            _ControlFont = new Font(FontName, 9, FontStyle.Regular);
            _EditControlFont = new Font(FontName, 10, FontStyle.Regular);
            _GridHeaderFont = new Font(FontName, 10, FontStyle.Bold);
           
            ControlForeColor = System.Drawing.Color.MediumBlue;
            EditForeColor = System.Drawing.Color.Navy;
            EditBackColor = Color.White;
            ControlBackColor = Color.White;
        }

        private static Font _ControlFont, _EditControlFont,_GridHeaderFont;
        public static Font GridHeaderFont
        {
            get
            {
                return _GridHeaderFont.Clone() as Font;
            }
        }
        public static Font ControlFont
        {
            get{
               return _ControlFont.Clone() as Font;
            }
            
        }
        public static Font EditControlFont
        {
            get
            {
                return _EditControlFont.Clone() as Font;
            }
        }
        public static Color EditForeColor { get; set; }
        public static Color ControlForeColor { get; set; }
        public static Color EditBackColor { get; set; }
        public static Color ControlBackColor { get; set; }
        
        
    }
}
